WARNING: This program has a bug, so we need to fix it. This bug is a logic error.

RULE: Use add value inside of your loop to change the variable's value as the loop runs.

  • Click Run. Watch the stage to see the problem. Our loop should make 8 butterflies, but it looks like only 1.
  • Debug the program so that the butterflies appear in a row.
  • Use an Add Value command to add 2 to x each time the loop runs.

To navigate the page using the TAB key, first press ESC to exit the code editor.

# THIS ACTIVITY IS IN PREVIEW ONLY MODE
  • Run Code
  • Submit Work
  • Next Activity
  • Show Console
  • Reset Code Editor
  • Codesters How To (opens in a new tab)